import Vue from "vue";
import VueRouter from "vue-router";
import Home from "../views/Home";
import Footer from "../layout/Footer";
import Nav from "../layout/Nav";
Vue.use(VueRouter);

const routes = [
  {
    path: "/",
    name: "Home",
    components: {
      nav: Nav,
      main: Home,
      footer: Footer
    }
  },
  {
    path: "/demo",
    name: "Home",
    components: {
      nav: Nav,
      main: ()=>import('@/views/demo'),
      footer: Footer
    }
  },
];

const router = new VueRouter({
  mode: "history",
  base: process.env.BASE_URL,
  routes,
});

export default router;
